package top.gbiot;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.context.ApplicationContext;
import org.springframework.jms.annotation.EnableJms;
import top.gbiot.config.DeviceTemplateConfig;

import java.io.IOException;

/**
 * 启动程序
 * 
 * @author  hs
 */
@SpringBootApplication(exclude = { DataSourceAutoConfiguration.class })
@EnableJms
public class GBIotApplication  implements CommandLineRunner
{
    @Autowired
    DeviceTemplateConfig deviceTemplateConfig;

    public static void  main(String[] args) throws IOException {
        // System.setProperty("spring.devtools.restart.enabled", "false");
        ApplicationContext context= SpringApplication.run(GBIotApplication.class, args);
        DeviceTemplateConfig deviceTemplateConfig1 = context.getBean(DeviceTemplateConfig.class);
        System.out.println("(♥◠‿◠)ﾉﾞ 启动成功  ");
        deviceTemplateConfig1.loadDeviceFeature();

    }

    @Override
    public void run(String... args){
       // deviceTemplateConfig.loadDeviceFeature();
    }
}